package com.edou.member.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;

import com.edou.member.entity.MemberUserCompany;
import com.edou.member.dto.MemberUserCompanyCondition;

/**
 * 会员企业关联表
 * @creator     
 * @create-time 2016/4/25 15:00:52
 * @email admin@edou.com
 * @company www.edou.com
 * @version 1.0
 */
@Repository("memberUserCompanyDaoImpl")
public interface IMemberUserCompanyDao {

	/**
	 * 查询所有会员企业关联表
	 */
	List<MemberUserCompany> listMemberUserCompanyAll();

	/**
	 * 查询区间数据
	 * @param bounds RowBounds对象
	 * @param condition 查询条件类
	 */
	List<MemberUserCompany> listMemberUserCompanyByPage(RowBounds bounds,@Param("condition") MemberUserCompanyCondition condition);

	/**
	 * 查询总数
	 * @param condition 查询条件类
	 * @return 总条数
	 */
	int listMemberUserCompanyByPageCount(@Param("condition") MemberUserCompanyCondition condition);

	/**
	 * 根据ID查询
	 * @param id 主键
	 * @return 会员企业关联表
	 */
	MemberUserCompany getMemberUserCompanyById(@Param("id") String id);

	/**
	 * 新增
	 * @param item 会员企业关联表
	 */
	void add(MemberUserCompany item);

	/**
	 * 修改
	 * @param item 会员企业关联表
	 */
	void update(MemberUserCompany item);

	/**
	 * 根据ID集合批量删除
	 * @param ids ID集合
	 */
	void delByIds(String[] ids);
	
	/**
	 * 根据memberUserId查询
	 * @param memberUserId
	 * @return
	 */
	MemberUserCompany getMemberUserCompanyByUserId(@Param("memberUserId") String memberUserId);
	
	/**
	 * 根据memberUserId删除
	 * @param memberUserId
	 */
	void delByUserId(@Param("memberUserId") String memberUserId);
	
	/**
	 * 根据会员id和是否子节点，查找集团和医院 
	 * @param memberUserId
	 * @param isLeaf
	 * @return
	 */
	MemberUserCompany getMemberUserCompanyByUserIdAndIsleaf(@Param("memberUserId") String memberUserId,@Param("isLeaf") Integer isLeaf);

}